if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_getBillByIEID]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_getBillByIEID]
GO
CREATE PROC exec sp_getBillByIEID 3
	@id int
AS
BEGIN
	SELECT A.ID, A.BillID, A.ProductID, A.Number, A.Price, A.Amount, B.ProductName, C.Discount
		FROM BillDetails As A
			LEFT JOIN Product As B ON A.ProductID = B.ID
			LEFT JOIN importexportbills As C ON A.BillID = C.ID
		WHERE A.BillID = @id
END